#!/usr/bin python3
# -*- coding:UTF-8 -*-
# Author: nigo
import plotly.graph_objects as go

# 数据
labels = ['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen']
values = [4500, 2500, 1053, 500]
# 轨迹
pie = go.Pie(labels=labels,values=values)
# 画布
fig = go.Figure(pie)
# 更新轨迹 文本显示百分比和label名称，文本位置为内部
fig.update_traces(textinfo='percent+label',textposition='inside')
# 更新样式
fig.update_layout(title='结构图')
# 显示画布
fig.show()

